<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('移交用户')" />
</head>
<body class="white-bg">
    <input id="ids" name="ids" type="hidden" th:value="${ids}"/>
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form id="formId">
            <div class="select-list" style="margin-left: 90px;">
                <ul>
                    <li>
                        <p>转移用户：</p>
                        <select id="userId" name="userId">

                        </select>
                    </li>
                </ul>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "system/agent";
        $(function() {
            $.get(prefix + "/getSysUserList", function(data) {
                //console.log(data);
                var str = '<option value="">请选择</option>';
                for(var i=0;i<data.length;i++){
                    str += '<option value="'+data[i].userId+'">'+data[i].userName+'</option>';
                }
                $('#userId').html(str);
            });
        });

        function submitHandler() {
            var ids = $('#ids').val();
            var userId = $('#userId').val();
            if(userId==''){
                $.modal.alertWarning("请选择转移用户");
                return;
            }
            $.operate.save(prefix + "/changeAgentUser", {"ids":ids, "userId":userId});
            window.parent.$.table.refresh();
        }
    </script>
</body>
</html>